package com.hancher.gamelife2.colockin;

import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hancher.common.androidutil.AssetUtil;
import com.hancher.common.rv.BaseVBAdapter;
import com.hancher.gamelife2.databinding.ItemColockInSignBinding;

import java.io.File;

/**
 * 作者 : Hancher ytu_shaoweijie@163.com <br/>
 * 时间 : 2023/5/21 17:37 <br/>
 * 描述 :
 */
public class ColockInSignAdapter extends BaseVBAdapter<ItemColockInSignBinding, ColockInTypePO> {


    @Override
    protected ItemColockInSignBinding createViewBinding(LayoutInflater from, ViewGroup viewGroup) {
        return ItemColockInSignBinding.inflate(from, viewGroup, false);
    }

    @Override
    protected void convertItem(ItemColockInSignBinding binding, int position, ColockInTypePO item) {
        Bitmap bitmap = AssetUtil.getImage(getContext(), "colockintype" + File.separator + item.getBitmapPath());
//        Glide.with(getContext()).load(bitmap).into(binding.itemImage);
        binding.itemImage.setImageBitmap(bitmap);
        binding.itemTitle.setText(item.getTitle());
        binding.itemCount.setText("打卡" + item.getCount() + "次");
    }

}
